# -*- coding: utf-8 -*-
from .models import *
import xadmin

class WorkFlowAdmin(object):
    list_display = ['name','content_type']
    search_fields = ['name']
    list_filter = []
xadmin.site.register(WorkFlow, WorkFlowAdmin)

class NodeAdmin(object):
    list_display = ['workflow', 'name','step','process']
    search_fields = ['name']
    list_filter = ['workflow']
    style_fields = {'process': 'm2m_transfer'}
xadmin.site.register(Node, NodeAdmin)

class NodeProcessAdmin(object):
    list_display = ['nextnode','kind']
    search_fields = []
    list_filter = ['kind']
xadmin.site.register(NodeProcess, NodeProcessAdmin)

class HistoryAdmin(object):
    list_display = ['workflow', 'detail_id','user','node','create_at','finish_at','content']
    search_fields = ['content']
    list_filter = ['workflow','status']
xadmin.site.register(History, HistoryAdmin)

class HistoryDetailAdmin(object):
    list_display = ['history', 'node','approve_person','create_at','status','content']
    search_fields = ['content']
    list_filter = ['create_at','status']
xadmin.site.register(HistoryDetail, HistoryDetailAdmin)

